// @flow
export default class Utils {
  constructor () {
    this.doc = document
    this.win = window
  }
  /**
   * 获取url query.
   * @param key
   * @returns {string}  value
   */
  queryString (key) {
    const uri = decodeURIComponent(window.location.href)
    const re = new RegExp('[&?]' + key + '=([^&]*)', 'ig')
    return ((uri.match(re)) ? (uri.match(re)[0].substr(key.length + 2)) : null)
  }
}
